package com.xs.anxingo.server.api.req;

import com.xs.anxingo.server.dto.BaseDto;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

import java.io.Serializable;

/**
 * Created by Administrator on 2019/12/10.
 */
@Setter
@Getter
public class BaseRequest extends BaseDto {

    private BaseReqData baseReqData = new BaseReqData();

    public String verification() {
        if (StringUtils.isEmpty(baseReqData.getSession())) {
            return "session不能为空";
        }
        if (StringUtils.isEmpty(baseReqData.getReqNo())) {
            return "请求流水号不能为空";
        }
        return null;
    }

    @Setter
    @Getter
    public class BaseReqData implements Serializable {
        /**
         * session
         */
        private String session;
        /**
         * 请求流水号
         */
        private String reqNo;
        /**
         * 请求设备 H5/IOS/Android
         */
        private String device;
        /**
         * 设备号
         */
        private String deviceNo;
        /**
         * 请求ip
         */
        private String ip;
    }
}
